#version 150
in vec4 vPosition;
in vec4 vColor;
in vec3 vNormal;

out vec3 N,L,E,H;
out vec4 color;
out vec3 pos;

uniform vec4 LightPosition;

uniform mat4 ModelView;
uniform mat4 Projection;

void main()
{
    // Transform vertex  position into eye coordinates
    pos = (ModelView * vPosition).xyz;

    // Transform vertex normal into eye coordinates
    N = normalize(ModelView*vec4(vNormal, 0.0)).xyz;
    L = normalize(LightPosition.xyz - pos);
    E = normalize(-pos);
    H = normalize(L+E);


    gl_Position = Projection * ModelView * vPosition;
}
